package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;

import java.util.List;

import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.E_LEVEL;
import static org.jsola.core.example.BaseExample.E_PARENT_ID;
import static org.jsola.core.example.BaseExample.E_SORT;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;
import static org.jsola.core.example.BaseExample.N_LEVEL;
import static org.jsola.core.example.BaseExample.N_PARENT_ID;
import static org.jsola.core.example.BaseExample.N_SORT;
import static org.jsola.hr.example.FormGroupExample.E_FORM_TYPE;
import static org.jsola.hr.example.FormGroupExample.E_MODULE_CODE;
import static org.jsola.hr.example.FormGroupExample.E_MODULE_NAME;
import static org.jsola.hr.example.FormGroupExample.E_SUBJECT_ID;
import static org.jsola.hr.example.FormGroupExample.E_SUBJECT_TYPE;
import static org.jsola.hr.example.FormGroupExample.M_FORM_TYPE_MAX;
import static org.jsola.hr.example.FormGroupExample.M_FORM_TYPE_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.M_LEVEL_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.M_MODULE_CODE_MAX;
import static org.jsola.hr.example.FormGroupExample.M_MODULE_CODE_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.M_MODULE_NAME_MAX;
import static org.jsola.hr.example.FormGroupExample.M_MODULE_NAME_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.M_PARENT_ID_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.M_SORT_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.M_SUBJECT_ID_MAX;
import static org.jsola.hr.example.FormGroupExample.M_SUBJECT_ID_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.M_SUBJECT_TYPE_MAX;
import static org.jsola.hr.example.FormGroupExample.M_SUBJECT_TYPE_NOT_NULL;
import static org.jsola.hr.example.FormGroupExample.N_FORM_TYPE;
import static org.jsola.hr.example.FormGroupExample.N_MODULE_CODE;
import static org.jsola.hr.example.FormGroupExample.N_MODULE_NAME;
import static org.jsola.hr.example.FormGroupExample.N_SUBJECT_ID;
import static org.jsola.hr.example.FormGroupExample.N_SUBJECT_TYPE;

/**
 * 表单字段分组
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【表单字段分组】的参数")
@Data
public class FormGroupUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private Long id;

    @ApiModelProperty(notes = N_MODULE_NAME, example = E_MODULE_NAME, required = true)
    @NotNull(message = M_MODULE_NAME_NOT_NULL)
    @Length(max = 100, message = M_MODULE_NAME_MAX)
    private String moduleName;

    @ApiModelProperty(notes = N_MODULE_CODE, example = E_MODULE_CODE, required = true)
    @NotNull(message = M_MODULE_CODE_NOT_NULL)
    @Length(max = 100, message = M_MODULE_CODE_MAX)
    private String moduleCode;

    @ApiModelProperty(notes = N_FORM_TYPE, example = E_FORM_TYPE, required = true)
    @NotNull(message = M_FORM_TYPE_NOT_NULL)
    @Length(max = 100, message = M_FORM_TYPE_MAX)
    private String formType;

    @ApiModelProperty(notes = N_SUBJECT_TYPE, example = E_SUBJECT_TYPE, required = true)
    @NotNull(message = M_SUBJECT_TYPE_NOT_NULL)
    @Length(max = 100, message = M_SUBJECT_TYPE_MAX)
    private String subjectType;

    @ApiModelProperty(notes = N_SUBJECT_ID, example = E_SUBJECT_ID, required = true)
    @NotNull(message = M_SUBJECT_ID_NOT_NULL)
    @Length(max = 100, message = M_SUBJECT_ID_MAX)
    private String subjectId;

    @ApiModelProperty(notes = N_PARENT_ID, example = E_PARENT_ID, required = true)
    @NotNull(message = M_PARENT_ID_NOT_NULL)
    private Long parentId;

    @ApiModelProperty(notes = N_SORT, example = E_SORT, required = true)
    @NotNull(message = M_SORT_NOT_NULL)
    private Long sort;

    @ApiModelProperty(notes = N_LEVEL, example = E_LEVEL, required = true)
    @NotNull(message = M_LEVEL_NOT_NULL)
    private Integer level;

    @ApiModelProperty(notes = "表单字段及内容")
    private List<FormGroupFieldDYCLUpdateDTO> formGroupFieldUpdateList;

}

